<!DOCTYPE html>
<html lang="zh-CN">
	  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>网上祭奠</title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
		<link href="css/jquery.mCustomScrollbar.css" rel="stylesheet">
		<link href="js/JBox/jBox.css" rel="stylesheet" />
		<link href="js/JBox/plugins/Notice/jBox.Notice.css"  rel="stylesheet"/>
		<link rel="stylesheet" href="css/index.css" />
    <!--[if lt IE 9]>
      <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    
    <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
    <script type="text/javascript" src="js/draggabilly.pkgd.js"></script>
    <script type="text/javascript" src="js/jquery.mCustomScrollbar.js" ></script>
    <script type="text/javascript" src="js/jquery.mCustomScrollbar.concat.min.js" ></script>
    <script type="text/javascript" src="js/JBox/jBox.js" ></script>
    <script type="text/javascript" src="js/JBox/plugins/Notice/jBox.Notice.js" ></script>
    <script type="text/javascript" src="js/jquery.easing.1.3.js" ></script>
    <script type="text/javascript" src="js/move-top.js" ></script>
    <script type="text/javascript" src="js/jquery.cookie.js" ></script>
    <script type="text/javascript">
    	
    	if($.cookie("JP")==null||$.cookie("JP")=="null"){
    		window.location="Login.html";
    	}
    	
    	$(document).ready(function(){
    		$().UItoTop({ easingType: 'easeOutQuart' });
    		initMemorialFamous();
    		initMemorialAns();
    		initMemorialFamily();
    		initMemorialOthers();
    	}); 
    	
    	function crtTimeFtt(val, row) {
	    	if (val != null) {
	            var date = new Date(val);
	            return date.getFullYear() + '/' + (date.getMonth() + 1) + '/' + date.getDate();
	        }
			}
    	
    	function initMemorialFamous(){
    		$.ajax({
	          url: "/api/Memorial/GetMemorialList?note1Type=1",
	          type: "GET",
	          dataType: "json", 
	          success: function (data) {	
							var dataObj=eval(data);
							var html="";
							for(var i=0;i<dataObj.Data.length&&i<3;i++){
								var path=dataObj.Data[i]._mphotopath;
								if(path==""||path==null)
									path="img/unknown.png";
								html+="<a href='Shrine.html?m="+dataObj.Data[i]._id+"'><div class='col-lg-4 col-md-4 col-sm-4 col-xs-4 index-famous'>";
								html+="<div class='index-famous-frame'>";
								html+="<div class='index-famous-face' style='background-image: url("+path+");'></div>";
								html+="<h4>"+dataObj.Data[i]._mname+"</h4>";
								html+="<p>"+crtTimeFtt(dataObj.Data[i]._birthdate)+"</p><p>"+crtTimeFtt(dataObj.Data[i]._deathdate)+"</p>";
								html+="</div></div></a>";
							}	
							$(".index-worship1 .row").html(html);											
           },
           error:function(XMLHttpRequest,textStatus,errorThrown)
           {
           	console.log(errorThrown);
           }
         });
    	}
    	
    	function initMemorialAns(){
    		$.ajax({
	          url: "/api/Memorial/GetMemorialList?note1Type=2",
	          type: "GET",
	          dataType: "json", 
	          success: function (data) {	
							var dataObj=eval(data);
							var html="";
							for(var i=0;i<dataObj.Data.length&&i<3;i++){
								var path=dataObj.Data[i]._mphotopath;
								if(path==""||path==null)
									path="img/unknown.png";
								html+="<a href='Shrine.html?m="+dataObj.Data[i]._id+"'><div class='col-lg-4 col-md-6 col-sm-12 col-xs-12 index-ans'>";
								html+="<div class='index-ans-frame'>";
								html+="<div class='index-ans-face' style='background-image: url("+path+");'></div>";
								html+="<h4>"+dataObj.Data[i]._mname+"</h4>";
								html+="<section>"+dataObj.Data[i]._mresume+"</section>";
								html+="<p>"+crtTimeFtt(dataObj.Data[i]._birthdate)+"-"+crtTimeFtt(dataObj.Data[i]._deathdate)+"</p>";
								html+="</div></div></a>";
							}	
							$(".index-worship2 .row").html(html);											
           },
           error:function(XMLHttpRequest,textStatus,errorThrown)
           {
           	console.log(errorThrown);
           }
         });
    	}
    	
    	function initMemorialFamily(){
    		$.ajax({
	          url: "/api/Memorial/GetMemorialList?note1Type=3",
	          type: "GET",
	          dataType: "json", 
	          success: function (data) {	
							var dataObj=eval(data);
							var html="";
							for(var i=0;i<dataObj.Data.length&&i<3;i++){
								var path=dataObj.Data[i]._mphotopath;
								if(path==""||path==null)
									path="img/unknown.png";
								html+="<a href='Shrine.html?m="+dataObj.Data[i]._id+"'><div class='col-lg-4 col-md-6 col-sm-12 col-xs-12 index-ans'>";
								html+="<div class='index-ans-frame'>";
								html+="<div class='index-ans-face' style='background-image: url("+path+");'></div>";
								html+="<h4>"+dataObj.Data[i]._mname+"</h4>";
								html+="<section>"+dataObj.Data[i]._mresume+"</section>";
								html+="<p>"+crtTimeFtt(dataObj.Data[i]._birthdate)+"-"+crtTimeFtt(dataObj.Data[i]._deathdate)+"</p>";
								html+="</div></div></a>";
							}	
							$(".index-worship3 .row").html(html);											
           },
           error:function(XMLHttpRequest,textStatus,errorThrown)
           {
           	console.log(errorThrown);
           }
         });
    	}
    	
    	function initMemorialOthers(){
    		$.ajax({
	          url: "/api/Memorial/GetMemorialList?note1Type=4",
	          type: "GET",
	          dataType: "json", 
	          success: function (data) {	
							var dataObj=eval(data);
							var html="";
							for(var i=0;i<dataObj.Data.length&&i<3;i++){
								var path=dataObj.Data[i]._mphotopath;
								if(path==""||path==null)
									path="img/unknown.png";
								html+="<a href='Shrine.html?m="+dataObj.Data[i]._id+"'><div class='col-lg-4 col-md-6 col-sm-12 col-xs-12 index-ans'>";
								html+="<div class='index-ans-frame'>";
								html+="<div class='index-ans-face' style='background-image: url("+path+");'></div>";
								html+="<h4>"+dataObj.Data[i]._mname+"</h4>";
								html+="<section>"+dataObj.Data[i]._mresume+"</section>";
								html+="<p>"+crtTimeFtt(dataObj.Data[i]._birthdate)+"-"+crtTimeFtt(dataObj.Data[i]._deathdate)+"</p>";
								html+="</div></div></a>";
							}	
							$(".index-worship4 .row").html(html);											
           },
           error:function(XMLHttpRequest,textStatus,errorThrown)
           {
           	console.log(errorThrown);
           }
         });
    	}
    </script>
  </head>
	<body style="overflow-x: hidden;">
		<div class="index-top">
			祭奠堂
		</div>
		<div class="jumbotron index-banner-main">
		</div>
		<div class="container index-menu-main">
			<div class="row">
				<a href="List.html?m=1"><div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 index-worshipmenu1">
				祭奠名人
				</div></a>
				<a href="List.html?m=2"><div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 index-worshipmenu2">
				祭奠先祖</p>
				</div></a>
				<a href="List.html?m=3"><div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 index-worshipmenu3">
				祭奠亲人
				</div></a>
				<a href="List.html?m=4"><div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 index-worshipmenu4">
				其他祭奠
				</div></a>
			</div>
		</div>
		<div class="index-worship1">
			<div class="index-worship-head">
				<span>祭奠名人</span>
				<a href="List.html?m=1"><div class="index-more" title="更多"></div></a>
			</div>
			<div class="row"></div>
		</div>
		<div class="index-worship2">
			<div class="index-worship-head">
				<span>祭奠先祖</span>
				<a href="List.html?m=2"><div class="index-more" title="更多"></div></a>
			</div>
		<div class="row"></div>
		</div>
		<div class="index-worship3">
			<div class="index-worship-head">
				<span>祭奠亲人</span>
				<a href="List.html?m=3"><div class="index-more" title="更多"></div></a>
			</div>
					<div class="row"></div>
		</div>
		<div class="index-worship4">
			<div class="index-worship-head">
				<span>其他祭奠</span>
				<a href="List.html?m=4"><div class="index-more" title="更多"></div></a>
			</div>
					<div class="row"></div>
				</div>
			</div>
		</div>
		<div class="toTop"  href="#to-top" id="toTop">
				返回<br/>顶部
			</div>
	</body>
</html>
